<?php $domain = $requestContext->domain; ?>

	
	<!-- Seednia home -->
	
	<form class="form-horizontal" id="FormDomainImage" name="FormDomainImage" method="post" action="<?php echo controller_base_path($requestContext); ?>/Domain/updateimage" enctype="multipart/form-data"  >
		<input type="hidden" id="sid" name="sid" value="<?php echo $domain->sid; ?>" />
		<fieldset>
			<legend>Domain Profile Image</legend>
			<div class="control-group" style="position:relative">
				<label class="control-label" for="profileImage">Profile picture</label>
				<div class="controls">
					<input type="file" id="profileImage" name="profileImage" 
						   value="" />
				</div>
				<div style="position: absolute;right: 5px;top: 0px;"><img src="<?php echo profile_img_url( $domain->profileImageSid, 400, 100) ?>" /></div>
			</div>
		</fieldset>
	</form>
	
	<form class="form-horizontal validating-form" id="FormDomain" name="FormDomain" method="post" action="<?php echo controller_base_path($requestContext); ?>/Domain/edit"  >
		<input type="hidden" id="sid" name="sid" value="<?php echo $domain->sid; ?>" />
		<fieldset>
			<legend>Domain Info</legend>
			<div class="control-group">
				<label class="control-label" for="name">Name</label>
				<div class="controls">
					<input type="text" id="name" name="name" class="required"
						   value="<?php echo Util_Data::getValueOf($domain, 'name'); ?>" />
				</div>
			</div>
			
			<div class="control-group">
				<label class="control-label" for="intro">Intro</label>
				<div class="controls">
					<input type="text" id="goals" name="intro" class="span12 required"
						value="<?php echo Util_Data::getValueOf($domain, 'intro'); ?>" />
				</div>
			</div>
			
			<div class="control-group">
				<label class="control-label" for="description">Description</label>
				<div class="controls">
					<textarea id="goals" name="description" class="span12"><?php echo Util_Data::getValueOf($domain, 'description'); ?></textarea>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label" for="status">Status</label>
				<div class="controls">
					<?php echo Form::select('status', array("1"=>"Active", "0"=>"Inactive"), Util_Data::getValueOf($domain, 'status')); ?>
				</div>
			</div>
			
			<div class="control-group">
				<label class="control-label" for="tagNamesCsv">Tags</label>
				<div class="controls">
					<input type="text" id="interestTagNamesCsv" name="tagNamesCsv" class="tag"
						    value="<?php echo Util_Data::getValueOf($domain, 'tagNamesCsv'); ?>" />
				</div>
			</div>
			
			<div class="control-group">
				<div class="controls">
					<button type="submit" class="btn">Update</button>
				</div>
			</div>

		</fieldset>
	</form>

<script type="text/javascript" src="http://jzaefferer.github.com/jquery-validation/jquery.validate.js"></script>
<script type="text/javascript">
// FYI jQuery: multiple $(document).ready() is possible.
$(document).ready(function() {
	$(".validating-form").validate();
	$('#profileImage').change(function() {
		$('#FormDomainImage').submit();
	});
	$(".tag").tagit({maxTags:25 });
});
</script>